package com.lzdongrui.backend.mapper;

import com.lzdongrui.backend.domain.ApplyLeave;
import com.lzdongrui.backend.domain.StudentInstructor;
import com.lzdongrui.backend.domain.dto.ApplyLeaveDTO;
import com.lzdongrui.backend.domain.vo.ApplyLeaveVO;
import com.lzdongrui.backend.domain.vo.BarChartVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 请假申请Mapper接口
 *
 * @author wyh
 * @date 2023-05-16
 */
public interface ApplyLeaveMapper {
    /**
     * 查询请假申请
     *
     * @param id 请假申请主键
     * @return 请假申请
     */
    public ApplyLeave selectApplyLeaveById(Long id);

    /**
     * 查询请假申请列表
     *
     * @param applyLeaveDTO 请假申请
     * @return 请假申请集合
     */
    public List<ApplyLeaveVO> selectApplyLeaveList(ApplyLeaveDTO applyLeaveDTO);

    /**
     * 新增请假申请
     *
     * @param applyLeave 请假申请
     * @return 结果
     */
    public int insertApplyLeave(ApplyLeaveDTO applyLeave);

    /**
     * 修改请假申请
     *
     * @param applyLeave 请假申请
     * @return 结果
     */
    public int updateApplyLeave(ApplyLeave applyLeave);

    /**
     * 修改进行中假期为结束
     *
     * @param stu,beginTime 调整进行中假期为结束
     * @return 结果
     */
    public int updateLeaveToEliminate(@Param("stu") Long stu, @Param("beginTime") Date beginTime);


    /**
     * 删除请假申请
     *
     * @param id 请假申请主键
     * @return 结果
     */
    public int deleteApplyLeaveById(Long id);

    /**
     * 批量删除请假申请
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteApplyLeaveByIds(Long[] ids);

    /**
     * 辅导员审核通道
     *
     * @param applyLeaveDTO
     * @return
     */
    List<ApplyLeaveVO> selectApplyLeaveListInstructor(ApplyLeaveDTO applyLeaveDTO);

    /**
     * 获取对应学院下的部门所能看到的审核数据
     *
     * @param sletDto
     * @return
     */
    List<ApplyLeaveVO> selectApplyLeaveListInCollGrop(ApplyLeaveDTO sletDto);

    List<ApplyLeaveVO> selClientStuApplyLeave(ApplyLeaveDTO applyLeaveDTO);

    List<ApplyLeaveVO> selClientStuApplyLeaveLast(Long stuId);

    /**
     * 获取该学生的辅导员部门信息
     *
     * @param stu
     * @return
     */
    StudentInstructor selectStudenTeacherbyId(Long stu);

    List<ApplyLeaveVO> selStuOnStaledated(ApplyLeaveDTO applyLeaveDTO);

    List<ApplyLeave> selApplyLeaveTimerList();

    ApplyLeave selExtendLeaveByStu(ApplyLeaveDTO applyLeave);

    List<BarChartVO> selectApplyLeaveBarChart(ApplyLeaveDTO applyLeaveDTO);

    List<BarChartVO> selectLeaveBarChartNtoInstructor(ApplyLeaveDTO applyLeaveDTO);

    List<BarChartVO> selectLeaveBarChartInInstructor(ApplyLeaveDTO applyLeaveDTO);
}
